Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Makes it EVEN EASIER to work with atom item interactions ft. "Leaf and Branch" & "Death to Chains" #2958

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Nova: NovaSector/NovaSector#2053
Original PR: tgstation/tgstation#82625

About The Pull Request

When I made the new item interaction chain, I did this pattern for items interacting with atoms:

https://github.com/tgstation/tgstation/blob/d2956ae821c6a865d8ee3de0d4b92979a9d08e32/code/game/atom/atom_tool_acts.dm#L85-L86

This is VERY clean and makes it ridiculously easy to add item-to-atom interactions without worry about needing to fuss around with calling parent and checking parent return value, IE, dealing with the dreaded chain.

Of course for some reason when I did this I didn't do the same for atom-from-item interactions themselves, relying on people call parent and check for blockers. Which worked in my head but is not easy to pick up as a new contributor.

So here we are, hopefully the final version of the atom-item-non-combat-interact chain.

Base item_interaction that handles all the signals and calling relevant procs is now base_item_interaction

item_interaction is now a stub proc that atoms can override at whim without worrying about parent calls (unless subtypes implement it).

This results in MUCH cleaner and easier to work with code.

And as an added bonus, it's (technically) completely backwards compatible with existing code. I changed it just for posterity but for downstreams and such, they don't even need to change anything, and it'll work as it did before.

Changelog

🆑 Melbert
refactor: Atom-Item interactions have been refactored once more. Report any oddities.
/:cl:

… "Leaf and Branch" & "Death to Chains" (#2053)

* Makes it EVEN EASIER to work with atom item interactions ft. "Leaf and Branch" & "Death to Chains" (#82625)

* Makes it EVEN EASIER to work with atom item interactions ft. "Leaf and Branch" & "Death to Chains"

* Update apc.dm

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Mal <[email protected]>
@ReezeBL ReezeBL merged commit e377cf0 into master Apr 19, 2024
27 checks passed
@ReezeBL ReezeBL deleted the upstream-mirror-2053 branch April 19, 2024 07:22
AnywayFarus added a commit that referenced this pull request Apr 19, 2024
Iajret pushed a commit that referenced this pull request Jun 11, 2024
…ade Rework" [MDB IGNORE] (#2958)

* Revert "Changeling Rebalance: Kill It With Fire, feat. Armblade Rework" (#83842)

Closes #83841
Closes #83843

* Revert "Changeling Rebalance: Kill It With Fire, feat. Armblade Rework"

---------

Co-authored-by: oranges <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants